// 器材报废
import request from "@/api/request";
//   headers: { "Content-Type": "application/json;charset=UTF-8" },

// 查询所有器材报废单
export const select_equip = (params) => {
    return request({
      url: "/equipmentmanage/scrap/selectAll",
      method: "post",
      data:params,
    });
  };

//   新增报废单
  export const add_equip = (params) => {
    return request({
      url: "/equipmentmanage/scrap/insert",
      method: "post",
      data:params,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  };

//   查询单据详情
export const details_equip = (params) => {
    return request({
      url: "/equipmentmanage/scrap/selectDetails/"+params,
      method: "post",
    //   headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  };

//   修改报废单
  export const update_equip = (params) => {
    return request({
      url: "/equipmentmanage/scrap/update",
      method: "post",
      data:params,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  };

//   删除器材报废单
export const delete_equip = (params) => {
    return request({
      url: "/equipmentmanage/scrap/delete/"+params,
      method: "post",
    });
  };

  //删除子表
  export const delete_son = (params) => {
    return request({
      url: "/equipmentmanage/scrap/deleteByFId/"+params,
      method: "post",
    });
  };

//   报废人员
export const User_scrap = (params) => {
    return request({
      url: "/equipmentmanage/scrap/personList/"+params,
      method: "post",
    });
  };

//   结算部门
  export const section_scrap = () => {
    return request({
      url: "/equipmentmanage/scrap/orgList",
      method: "post",
    });
  };

  // 仓库列表
  export const ck_scrap = () => {
    return request({
      url: "/equipmentmanage/scrap/depotList ",
      method: "post",
    });
  };

  // 器材报废单提交
  export const submit_scrap = (params) => {
    return request({
      url: "/equipmentmanage/scrap/commit ",
      method: "post",
      data:params,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  };

  // 获取单据审核历史
  export const history_scrap = (params) => {
    return request({
      url: "/equipmentmanage/scrap/getAuditHistory ",
      method: "post",
      data:params,
      // headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  };

  // 器材报废单审核
  export const audit_scrap = (params) => {
    return request({
      url: "/equipmentmanage/scrap/audit ",
      method: "post",
      data:params,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  };

// 单据作废
export const cancel_scrap = (params) => {
  return request({
    url: "/equipmentmanage/scrap/cancel ",
    method: "post",
    data:params,
    // headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 器材报废单回退
export const undo_scrap = (params) => {
  return request({
    url: "/equipmentmanage/scrap/undo ",
    method: "post",
    data:params,
    // headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};


// 上传附件
export const upload_scrap = (params) => {
  return request({
    url: "/equipmentmanage/ea/upload",
    method: "post",
    data:params,
    // headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};


// 文件附件列表
export const accessory_scrap = (params) => {
  return request({
    url: "/equipmentmanage/ea/accessoryList/"+params,
    method: "post",
    // headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 储位选项
export const orglist_scrap = () => {
  return request({
    url: "/equipmentmanage/scrap/proOrgList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 删除附件
export const delete_fj = (params) => {
  return request({
    url: "/equipmentmanage/ea/deleteAccessory/"+params,
    method: "post",
  });
};

// 下载附件
export const download_fj = (params) => {
  return request({
    url: "/equipmentmanage/ea/download",
    data:params,
    method: "post",
  });
};